<?php
$con = mysqli_connect(
    "127.0.0.1",
    "root",
    "310831"
);

$sql = "CREATE DATABASE if not exists fatie";


if (mysqli_query($con, $sql)) {
    echo "";
} else {
    echo "创库失败: " . mysqli_error($con);
}

echo "<br>";
// 创建数据表
$sql = "use fatie;";
mysqli_query($con, $sql);
$sql_tb = "
    CREATE TABLE if not exists demo01(
        ID int PRIMARY KEY ,
        username varchar(50),
        time Timestamp,
        remark varchar(150)
        
)";


if (!mysqli_query($con,$sql_tb )) {
    die('创建tableb表失败' . mysqli_error($con));
} else {
    echo "<br>";

}
